package cn.wubo.jooq.demo.controller;

import org.jooq.DSLContext;
import org.jooq.Record;
import org.jooq.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

@RequestMapping(value = "/demo")
public class DemoController {

    @Autowired
    DSLContext dslContext;

    @GetMapping(value = "/1")
    public String demo1(){
        Result<Record> recordResult = dslContext.select().from("demotable").limit(0,10).fetch();
        return recordResult.toString();
    }
}
